package org.jwos.plugin.file.util;

import javax.jcr.LoginException;
import javax.jcr.RepositoryException;

import org.jwos.platform.domain.User;
import org.jwos.plugin.file.dao.FileManagerDAO;
import org.jwos.plugin.file.jcr.util.RepositorySessionFactory;

public class RepositoryUtil {
	
	public static void initRepository(String username, String password) throws LoginException, RepositoryException {

		RepositorySessionFactory.openSession(username, password);

		FileManagerDAO cao = new FileManagerDAO();
		cao.registerUser(User.USER_ADMIN);
		
		RepositorySessionFactory.closeSession();		
	}

}
